package cn.lhx.blog.service.impl;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.transaction.annotation.Transactional;

import cn.lhx.blog.dao.DaoGuestMessage;
import cn.lhx.blog.pojo.GuestMessage;
import cn.lhx.blog.service.GusetBookService;
@Transactional
public class GuestBookServiceBean implements GusetBookService {
	@Resource(name="daoGuestMessage")
	private DaoGuestMessage daoGuestMessage;
	
	/* (non-Javadoc)
	 * @see cn.lhx.blog.service.impl.GusetMessageService#saveMessage(cn.lhx.blog.pojo.GuestMessage)
	 */
	public GuestMessage saveMessage(GuestMessage m){
		daoGuestMessage.getHibernateTemplate().save(m);
		return null;
	}
	/* (non-Javadoc)
	 * @see cn.lhx.blog.service.impl.GusetMessageService#delMessage(java.io.Serializable)
	 */
	public GuestMessage delMessage(Serializable id){
		return null;
	}
	/* (non-Javadoc)
	 * @see cn.lhx.blog.service.impl.GusetMessageService#getMessages(int, int)
	 */
	public List<GuestMessage> getMessages(int begin ,int size){
		List<GuestMessage> messages=null;
		 messages=daoGuestMessage.getHibernateTemplate().find("from GuestMessage");
		return messages;
	}
	
	
	

}
